package service.impl;

import dao.ComcollectDao;
import dao.UserDao;
import dao.impl.ComcollectDaoImpl;
import dao.impl.UserDaoImpl;
import pojo.Comcollect;
import pojo.User;
import service.ComcollectService;
import service.UserService;
import util.PageBean;

import java.util.List;

/**
 * 商品收藏表的service层接口实现类
 * @author 代传斌
 */
public class ComcollectServiceImpl implements ComcollectService {


    ComcollectDao cd=new ComcollectDaoImpl();
      UserService us=new UserServiceImpl();

    /**
     * 新增
     * @param cl
     * @return
     */
    @Override
    public int addComcollect(Comcollect cl) {
        return cd.addComcollect(cl);
    }

    /**
     * 删除
     * @param ctId
     * @return
     */
    @Override
    public int deleteComcollect(int ctId) {
        return cd.deleteComcollect(ctId);
    }

    /**
     * 修改
     * @param cl
     * @return
     */
    @Override
    public int updateComcollect(Comcollect cl) {
        return cd.updateComcollect(cl);
    }

    /**
     * 分页查询
     * @param pb
     * @param uNickName
     * @return
     */
    @Override
    public PageBean queryComcollect(PageBean pb, String uNickName) {
        return cd.pageList(pb, uNickName);
    }

    /**
     *查询单个会员信息
     * @param uNickName
     * @return
     */
    @Override
    public User getUser(String uNickName) {
        return cd.findByName(uNickName);
    }

    @Override
    public List<User> quareUser() {
        return cd.list();
    }

    @Override
    public Comcollect findComcollect(int ctId) {
        return cd.findComcollect(ctId);
    }

    @Override
    public List<Comcollect> listComcollect() {
        return cd.listComcollect();
    }

    @Override
    public PageBean ComcollectList(PageBean pb, int ctId, String uNickName) {
        return cd.ComcollectList(pb,ctId,uNickName);
    }

    @Override
    public int countComcollect(int ctId, String uNickName) {
        return cd.countComcollect(ctId,uNickName);
    }


}
